package com.hua.designpattern.structural.filter;

import java.util.ArrayList;
import java.util.List;

public class FilterOr implements Filter {

	private Filter firstFilter;

	private Filter secondFilter;

	public FilterOr(Filter firstFilter, Filter secondFilter) {
		this.firstFilter = firstFilter;
		this.secondFilter = secondFilter;
	}

	@Override
	public List<BaseObject> matchFilter(List<BaseObject> objects) {
		List<BaseObject> results = new ArrayList<BaseObject>();
		results.addAll(firstFilter.matchFilter(objects));
		results.addAll(secondFilter.matchFilter(objects));
		return results;
	}

}
